package com.zsh.wanandroid;

import android.animation.ObjectAnimator;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;

import com.zsh.wanandroid.base.BaseActivity;
import com.zsh.wanandroid.common.APP;
import com.zsh.wanandroid.ui.activity.LoginActivity;
import com.zsh.wanandroid.ui.activity.MainActivity;

/**
 * @author zsh
 * @date 2020/3/11.
 * 功能：Activity欢迎页
 */
public class SplashActivity extends BaseActivity {

    private ImageView ivIcon;

    @Override
    public void initPrams(Bundle prams) {

    }

    @Override
    public View bindView() {
        return null;
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_splash;
    }

    @Override
    public void initView(View view) {
        ivIcon = $(R.id.ivIcon);
    }

    @Override
    public void setListener() {

    }

    @Override
    public void widgetClick(View v) {

    }

    @Override
    public void doBusiness(Bundle savedInstanceState) {
        animator();
        //延时3秒跳转页面
        APP.mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(MainActivity.class);
                finish();
            }
        }, 3000);
    }

    private void animator() {
        ObjectAnimator animator = ObjectAnimator.ofFloat(ivIcon, "rotation", 0f, 360f);
        animator.setDuration(3000);
        animator.start();
    }
}
